<?php


/**
 * 用户管理Model
 * Enter description here ...
 * @author Admin
 *
 */
class UserModel extends CommonModel {

	protected $_validate	 =	 array(
		array('mail','require','邮箱必须！'),
		array('mail','email','邮箱格式不正确！'),
		array('mail','','邮箱必须唯一！',0,'unique',1),
		array('name','require','昵称必须！'),
		array('name','','昵称必须唯一！',0,'unique'),
		array('ip','/\d+\.\d+\.\d+\.\d+/','IP格式不正确！',2),
		array('phone','/\d{11}|\d{4}-[\d{7}|\d{8}]/','移动电话格式不正确！',2),
	);
	
	protected $_auto = array ( 
		array('birthday','strtotime',3,'function'),
		array('addtime','time',1,'function'),   // 对addtime字段在更新的时候写入当前时间戳
	);
	
}
?>